package com.starbaba.base.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.base.common.exception.AppException;
import com.base.common.log.LogService;
import com.starbaba.base.dao.LoanManagerBaseDao;
import com.starbaba.base.service.CreditInfoService;
import com.tuanzi.server.loan_base.model.db.credit.CreditInfo;

public class CreditInfoServiceImpl extends LoanManagerBaseDao implements CreditInfoService{

	@Override
	public Map<Integer, String> getCreditInfoToMap() {
		
		String sql = "SELECT * FROM `credit_info`";
		List<CreditInfo> list = new ArrayList<CreditInfo>();
		Map<Integer, String> map = new HashMap<Integer, String>();
		try {
			
			list = getDao().list(sql, CreditInfo.class);
			for(CreditInfo creditInfo: list){
				
				map.put(creditInfo.getCredit_source(), creditInfo.getCredit_source_name());
				
			}
			
		} catch (AppException e) {
			LogService.error(e);
		}
		
		return map;
	}

}
